<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>人员注册-河北省建筑施工质量全过程监管系统</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Expires" CONTENT="0">
    <meta http-equiv="Cache-Control" content="no-siteapp,no-transform,no-store, no-cache, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/weadmin.css">
    <script type="text/javascript" src="/lib/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="/static/css/buildUnit/common.css">
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">
    <style>
        body {
            height: auto;
        }

        .content {
            width: 1200px;
            align-content: center;
            margin: 0 auto;
        }

        .layui-disabled {
            color: #aaa !important;
        }

        .personInfo {
            display: none;
        }

        .layui-form-checkbox[lay-skin=primary] span {
            color: #3366CC;
        }

        .footer_con {
            width: 345px;
            margin: 0 auto;
        }

        .footer_con_text p {
            margin-top: 10px;
        }

        .jsdwTr {
            display: none;
        }

        .personTr {
            display: none;
        }

        .top {
            height: 100px;
            position: relative;
            background: #F0F0F0 url(/static/images/1.png) no-repeat center center;
            background-size: 1400px auto;
        }

        .top_center {
            position: absolute;
            z-index: 4;
            top: 26px;
            width: 100%;
        }

        .rf {
            float: right;
            overflow: hidden;
        }

        .lf {
            float: left;
        }

        p {
            word-wrap: break-word;
        }

        .w1000 {
            width: 1200px;
            margin: 0 auto;
            height: auto;
            overflow: auto;
        }

        .yhzx {
            text-align: right;
            font-size: 17px;
            color: #1577dc;
        }

        .footer_con img {
            margin: 10px 20px 10px 0;
        }
    </style>
</head>
<body>
<div class="top">
    <div class="top_left"></div>
    <div class="top_center">
        <div class="w1000" style="position:relative;">

            <div class="rf">
                <div class="yhzx">
                    <a href="/pages/register/unit/signUp.html">企业注册</a>&nbsp;|&nbsp;
                    <a href="/pages/register/user/userSignUp.html">个人注册</a>&nbsp;|&nbsp;
                    <a href="/">已有账号？去登陆</a>
                </div>
            </div>
            <div class="cf"></div>
        </div>
    </div>
    <div class="top_right"></div>
</div>

<div class="content">
    <div class="layui-row registerBox">
        <div class="layui-col-xs4 layui-bg-blue">
            1、填写注册信息
        </div>
        <div class="layui-col-xs4 layui-bg-gray borderCustom">
            2、验证邮箱
        </div>
        <div class="layui-col-xs4 layui-bg-gray">
            3、登录系统
        </div>
    </div>
    <!--机构信息-->
    <form class="layui-form layui-form-pane" id="example" lay-filter="example">
        <table class="layui-table v-table">
            <tbody>
            <tr>
                <td class="th8 required" style="width: 120px;"> 姓名</td>
                <td>
                    <input type="text" name="realName" lay-verify="isEmpty" placeholder=""
                           autocomplete="off"
                           class="layui-input">
                </td>
                <td class="th8 required" style="width: 120px;">身份证号码</td>
                <td>
                    <input type="text" name="userCard" lay-verify="isEmpty" placeholder=""
                           autocomplete="off"
                           class="layui-input">
                    <div class="tdBz" style="color:red;">
                        注：默认登录名
                    </div>
                </td>
            </tr>
            <tr>
                <td class="th8 required">手机号</td>
                <td>
                    <input type="text" name="contact" id="contact"  lay-verify="isEmpty|linkPhone" placeholder=""
                           autocomplete="off"
                           class="layui-input">
                </td>
                <td class="th8 required">性别</td>
                <td>
                    <select name="gender" id="gender">
                        <option value="">请选择</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="th8 required">民族</td>
                <td>
                    <select name="nation" id="nation" class="formData" lay-verify="isEmpty">
                        <option value="">请选择</option>
                    </select>
                </td>
                <td class="th8 required">出生日期</td>
                <td>
                    <input type="text" class="layui-input formData" placeholder="请选择" name="birthDate" lay-verify="isEmpty" id="test1"
                           readonly/>
                </td>
            </tr>
            <tr>
                <td class="th8 required">邮箱</td>
                <td colspan="3">
                    <input type="text" name="email" lay-verify="isEmpty|email" placeholder="请输入"
                           autocomplete="off"
                           class="layui-input vEmail formData">
                    <input type="hidden" name="userId" id="userId" value="" class="formData">
                    <div class="tdBz" style="color:red;">
                        注：该该邮箱将作为密保邮箱，请谨慎填写
                    </div>
                </td>
            </tr>
            <tr>
                <td class="th8 required">登录密码</td>
                <td>
                    <input type="password" name="password" lay-verify="required|upass" placeholder=""
                           autocomplete="off"
                           class="layui-input password">
                    <div class="tdBz" style="color:red;">
                        注：数字、大小写字母或特殊符号组成，长度至少8位
                    </div>
                </td>
                <td class="th8 required">确认密码</td>
                <td>
                    <input type="password" name="password" lay-verify="required|upass" placeholder=""
                           autocomplete="off"
                           class="layui-input rePassword">
                </td>
            </tr>
            <tr>
                <td colspan="4" style="text-align: center;">
                    <input class="isAgree" type="checkbox" name="" title="我已经认真如实填写上述资料，并且对所填写的资料负责。" lay-skin="primary"
                           lay-filter="isAgree">
                </td>
            </tr>
            <tr>
                <td colspan="4" style="text-align: center;">
                    <button class="demo1 layui-btn layui-btn-disabled layui-btn-normal" lay-filter="demo1" lay-submit
                            disabled="true">
                        提交注册
                    </button>
                    <button onclick="cancel()" type="button" class="layui-btn">取消注册</button>
                </td>
            </tr>
            </tbody>
        </table>

    </form>
</div>
<div class="footer" style="background: #f3f3f3;padding: 30px 0px;box-sizing: border-box;">
    <div class="footer_con" style="color: #333;width: 345px;margin: 0px auto;box-sizing: border-box;padding: 0;">

        <!--
              <img class="lf" src="/statics/images/zd.png"  style="border: none;vertical-align: middle;float: left;margin: 30px 20px 10px 0px;
      }"/>
        -->
        <div class="footer_con_text" style="width: 500px;text-align: left;">
            <!--
             <p style="margin: 0;padding: 0;word-wrap: break-word;box-sizing: border-box;">
                <a>设为首页</a>|
                <a>联系我们</a>|
                <a>本站声明</a>
            </p>
            -->
            <p>主办单位：广西壮族自治区人民政府 技术支持：河北霄岭工程设计咨询有限公司</p>

        </div>
    </div>
</div>
<script src="/static/js/main.js"></script>
<script type="text/javascript">
    layui.use(['jquery', 'form', 'configure', 'configureCom','selectFun', 'sessionFun', 'bluebird', 'jsDictFile'], function () {
        var form = layui.form;
        var configure = layui.configure;
        var configureCom = layui.configureCom;
        var sessionFun = layui.sessionFun;
        var laydate = layui.laydate;
        var selectFun = layui.selectFun;
        window.$ = layui.jquery;
        var typeItem = '1';//注册类型 1企业 1个人
        //执行一个laydate实例
        laydate.render({
            elem: '#test1' //指定元素
        });
        var registerData = sessionFun.get(configure.SESSION_REGISTER_DATA);//存储注册信息
        var dataList ={};
        var orgNo = configureCom.GetQueryString('orgNo');
        if(orgNo){//通过企业注册审核
            sessionFun.remove(configure.SESSION_REGISTER_DATA);
            configureCom.postDataAjax(configure.COMPANY_GET_ORG_INFOMATION_HTTP,{orgNo:orgNo}).then(function (res) {
                dataList = res.org;
                configureCom.selectDataFun(configure.SEX, dataList.SEX, '#gender');//性别
                configureCom.selectDataFun(configure.NATION_CODE, dataList.NATION_CODE, '#nation');//民族
                form.render();
                form.val('example',dataList)
            });
        }else{//通过重新填写
            if(registerData){
                configureCom.selectDataFun(configure.SEX, registerData.SEX, '#gender');//性别
                configureCom.selectDataFun(configure.NATION_CODE, registerData.NATION_CODE, '#nation');//民族
                form.render();
                form.val('example', registerData);
            }else{//初始化进入
                sessionFun.remove(configure.SESSION_REGISTER_DATA);
                configureCom.selectDataFun(configure.SEX, '', '#gender');//性别
                configureCom.selectDataFun(configure.NATION_CODE, '', '#nation');//民族
            }
        }
        /* function changeIframe() {
             $('.attachmentList').attr('src', configureCom.nocache(configure.ATTA_LIST_HTML + '?checkType=36&type=add&dataId='));
         }

         changeIframe();*/

        form.render();
        form.verify({
            isEmpty: function (value, item) {
                var parentTr = $(item).parents('tr');
                if (!parentTr.is(':hidden')) {
                    if (!($.trim(value))) {
                        return '必填项不能为空';
                    }
                }
            }
        });
        //选择不同的注册类型
        form.on('radio(typeItem)', function (data) {
            typeItem = data.value;
            // 重置列表
            $('.layui-form')[0].reset();
            form.val("example", {orgPerson: typeItem});
            form.render();
            if (typeItem == '2') {//个人
                $('.personTr').show();
                $('.jgTr').hide();
            } else {
                $('.personTr').hide();
                $('.jgTr').show();
            }
        });


        /*window.fjLoaded = function () {//附件列表渲染完毕重设附件列表序号
            if (window.hideTrNum == 1) {
                window.frames["attachmentList"].window.$('#attaList tr:nth-child(2) td').first().html(1);
            }
        };*/

        //是否同意提示信息
        form.on('checkbox(isAgree)', function (data) {
            var isAgree = data.elem.checked;//是否被选中，true或者false
            if (isAgree) {
                $('.demo1').attr('disabled', false).removeClass('layui-btn-disabled');
                form.render();
            } else {
                $('.demo1').attr('disabled', true).addClass('layui-btn-disabled');
                form.render();
            }
        });

        //保存机构信息
        form.on('submit(demo1)', function (data) {
            var data = data.field;
            if ($('.rePassword').val() != $('.password').val()) {
                var msg = '两次输入的密码不一致';
                top.layer.msg(msg);
                return false;
            }
            configureCom.postDataAjax(configure.PEOPLE_REGISTER_HTTP, data).then(function (res) {
                if (res.code == 0) {
                    top.layer.alert('注册成功');
                    data.userId =res.userId;
                    sessionFun.set(configure.SESSION_REGISTER_DATA, data);
                    location.href = '../unit/email.html';
                }
            });
            //获取附件信息
            /*window.frames["attachmentList"].window.getAttaList(function (result) {
                //判断必传
                if (typeItem == '2010') {//企业信息俩个必传
                    if (result.length < 2) {
                        configureCom.loadOff();
                        top.layer.msg('请上传附件');
                        return false;
                    }
                } else {//其他 一个必传
                    if (result.length < 1) {
                        configureCom.loadOff();
                        top.layer.msg('请上传附件');
                        return false;
                    }
                }
                data.dataAttachmentDTOList = [{
                    attachmentFileDTOList: result
                }];
                configureCom.postAjax(configure.ORGANIZATION_HTTP, JSON.stringify(data)).then(function (res) {
                    configureCom.loadOff();
                    if (res.code == 1) {
                        top.layer.msg('注册成功');
                        top.layer.close(window.popIndex);
                    } else {
                        top.layer.msg(res.msg);
                    }
                });
            });*/
            return false;
        });
    });


    function cancel() {
        window.location.href = "/login.html";
    }
</script>
</body>
</html>
